<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
    <title>登录/注册</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/dm-common.css" />
</head>

<body style="background:white">
    <header class="aui-bar aui-bar-nav dmc-header">
        <a class="aui-pull-left  aui-btn" href="javascript:history.go(-1)">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" >登录/注册</div>
    </header>

    <div class="login-logo">
        <img src="../image/logo.png" width="100%" height="100%" alt="" srcset="">
    </div>

    <div class="login-content">
        <div class="login-phonenumber aui-border-b">
            <input type="number" name="" id="" placeholder="请输入手机号码">
            <div class="aui-iconfont aui-icon-my login-icon"></div>
        </div>
        <div class="login-checkcode aui-border-b aui-margin-b-15">
            <input type="number" name="" id="" placeholder="请输入验证码">
            <div class=" aui-btn login-getcode login-getcode-enabled" onclick="getCheckcode(this)">获取验证码</div>
            <div class="aui-iconfont aui-icon-lock login-icon"></div>
        </div>
        <div class=" aui-btn dmc-btn aui-margin-t-15 login-btn" onclick="location.href='index.html'">下一步</div>
    </div>

    <div class="login-footer">
        登录即代表您已经同意<a>《兜贷宝用户协议》</a>
    </div>
</body>

<script>
    function getCheckcode(el) {
        if (el.classList.contains('login-getcode-enabled')) {
            el.classList.remove('login-getcode-enabled');
            el.classList.add('login-getcode-disabled');
            let time = 5;
            let interval = null;
            let waitcode = function () {
                el.innerText = time + "s 后再次发送";
                time--;
                if (time < 0) {
                    clearInterval(interval);
                    el.classList.add('login-getcode-enabled');
                    el.classList.remove('login-getcode-disabled');
                    el.innerText = "获取验证码";
                }
            }
            waitcode();
            interval = setInterval(waitcode, 1000)
        }
    }
</script>

</html>